package game.ui.controls
{
	import game.ui.hud.*;
	import game.ui.core.*;
	
	import com.greensock.*;
	
	import flash.display.*;
	import flash.events.*;
	import flash.text.*;

	public class RxAlert extends RxGamePanel
	{
		private var m_animating:Boolean = false;
		private var m_buttonLabels:Array;
		protected var m_isBusy:Boolean = false;
		protected var m_callback:Function;
		protected var m_autoClose:Boolean = true;
		protected var m_buttonContainer:RxUIElementContainer;
		protected var m_buttonAlign:String;
		protected var m_minWidth:int = 590;
		protected var m_minHeight:int = 300;
		protected var m_paddingLeft:int;
		protected var m_paddingRight:int;
		protected var m_paddingTop:int;
		protected var m_paddingBottom:int;
		
		public function RxAlert(title:String = "", param2:String = "", labels:Array = null, param4:int = 0, param5:String = null, callback:Function = null, param7:Boolean = true, autoClose:Boolean = true, param9:Boolean = false)
		{
		}
		
		public function Show(param1:Boolean, param2:Boolean = true) : void
		{
			RxDialogManager.instance.ShowDialog(this, param1, true);
			if (param2)
			{
				CreateAnimation(false);
			}
		}
		
		private function CreateAnimation(param1:Boolean = false) : void
		{
			if (param1)
			{
				alpha = 1;
				TweenLite.to(this, 0.12, {alpha:0, onComplete:this.OnCloseAnimationComplete});
			}
			else
			{
				alpha = 0;
				TweenLite.to(this, 0.12, {alpha:1, onComplete:this.OnAnimationComplete});
			}
			this.m_animating = true;
		}
		
		private function OnAnimationComplete() : void
		{
			this.m_animating = false;
		}
		
		private function OnCloseAnimationComplete() : void
		{
			this.OnAnimationComplete();
			RemoveFromLayer();
		}
		
		public function SetMinWidth(width:int) : void
		{
			this.m_minWidth = width;
			InvalidateSize();
		}
		
		public function SetMinHeight(height:int) : void
		{
			this.m_minHeight = height;
			InvalidateSize();
		}
		
		public function SetCallback(param1:Function) : void
		{
			this.m_callback = param1;
		}
	}
}